# Maintainer: David Runge <dvzrv@archlinux.org>
# Contributor: judd <jvinet@zeroflux.org>

pkgname=alsa-oss
pkgver=1.1.8
pkgrel=3
pkgdesc="OSS compatibility library"
arch=('x86_64')
license=('GPL2')
url="https://www.alsa-project.org"
depends=('glibc')
makedepends=('alsa-lib')
# TODO: add oss
optdepends=('bash: for aoss')
provides=('libaoss.so' 'libalsatoss.so')
source=("https://www.alsa-project.org/files/pub/oss-lib/$pkgname-$pkgver.tar.bz2")
sha512sums=('42966af0ca1be33b4ab1e20b2e3320056ad6caf6ecc5ecde3ae19571809a2fa924dd91d9b2a5d5b6f345b29d937b079400d2a165dbe2b8a33b857cd406c4ac7c')

prepare() {
  cd "$pkgname-$pkgver"
  autoreconf -vfi
}

build() {
  cd "$pkgname-$pkgver"
  ./configure --prefix=/usr
  make
}

# test requires the oss package and /dev/dsp
# check() {
#   cd "$pkgname-$pkgver"
#   make -k check
#   test/osstest
# }

package() {
  depends+=('libasound.so')
  cd "$pkgname-$pkgver"
  make DESTDIR="$pkgdir" install
}
